//
//  IconTitleTableViewCell.m
//  YiFei
//
//  Created by maquanhong on 10/23/16.
//  Copyright © 2016 yous. All rights reserved.
//

#import "SendDataViewCell.h"
#import "Macro.h"
#import "PureLayout.h"

@interface SendDataViewCell ()

@property (nonatomic, strong) TapButton  *iconImageView;

@property (nonatomic, strong ) UILabel      *titleLable;

@end



@implementation SendDataViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addViewConstraints];
    }
    return self;
}

- (void)addViewConstraints {
    
    
    _iconImageView=[[TapButton alloc] init];
[_iconImageView setImage:[UIImage imageNamed:@"weixuanzhong"] forState:UIControlStateNormal];
[_iconImageView setImage:[UIImage imageNamed:@"xuanzhong"] forState:UIControlStateSelected];
    [self addSubview:_iconImageView];
    [_iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(20);
        make.centerY.mas_equalTo(self.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    [_iconImageView addTarget:self action:@selector(clicikBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    
    _titleLable =[[UILabel alloc] init];
    _titleLable.textColor=[UIColor blackColor];
    _titleLable.font=[UIFont systemFontOfSize:14.0];
    [_titleLable sizeToFit];
    _titleLable.textAlignment=NSTextAlignmentCenter;
    [self addSubview:_titleLable];
    [_titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(_iconImageView).offset(15);
        make.centerY.mas_equalTo(self.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(100, 220));
    }];
}


- (void)setDict:(NSDictionary *)dict{
    _titleLable.text = dict[@"发送方式"];
}

-(void)clicikBtn:(UIButton*)sender{
    sender.selected = !sender.selected;
    

}





@end





















